class Fruit {
    public void eat() {}
}

class Apple extends Fruit {
    @Override
    public void eat() {
        System.out.println("eat Apple");
    }
}

class Banana extends Fruit {
    @Override
    public void eat() {
        System.out.println("eat Banana");
    }
}

class Factory {
    public Fruit CreateFruit(String Kind) {
        if(Kind.equals("A")) return new Apple();
        if(Kind.equals("B")) return new Banana();
        return null;
    }
}
